package com.evil.application.api;

import com.evil.application.config.FeignErrorDecoder;
import com.evil.application.pojo.dto.button.*;
import com.evil.common.core.constant.ServiceNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 应用按钮 接口
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@FeignClient(name = ServiceNameConstant.APPLICATION_SERVICE, configuration = {FeignErrorDecoder.class})
public interface RemoteApplicationButtonService {

    /**
     * 添加应用按钮
     *
     * @param addButtonReqDTO addButtonReqDTO
     */
    @RequestMapping("/remote/application/button/add")
    void addButton(@Validated @RequestBody AddButtonReqDTO addButtonReqDTO);

    /**
     * 编辑应用按钮
     *
     * @param modifyButtonReqDTO modifyButtonReqDTO
     */
    @RequestMapping("/remote/application/button/modify")
    void modifyButton(@Validated @RequestBody ModifyButtonReqDTO modifyButtonReqDTO);

    /**
     * 复制应用按钮
     *
     * @param buttonId buttonId
     */
    @RequestMapping("/remote/application/button/copy")
    void copyButton(@RequestParam("buttonId") @NotNull(message = "按钮id不能为空") Long buttonId);

    /**
     * 删除应用按钮
     *
     * @param delButtonReqDTO delButtonReqDTO
     */
    @RequestMapping("/remote/application/button/del")
    void delButton(@Validated @RequestBody DelButtonReqDTO delButtonReqDTO);

    /**
     * 按钮列表[管理员]
     *
     * @param buttonListReqDTO buttonListReqDTO
     * @return List
     */
    @RequestMapping("/remote/application/button/list")
    List<ButtonInfoRespDTO> buttonList(@Validated @RequestBody ButtonListReqDTO buttonListReqDTO);

    /**
     * 根据按钮keys获取按钮列表
     *
     * @param buttonListForKeysReqDTO buttonListForKeysReqDTO
     * @return List
     */
    @RequestMapping("/remote/application/button/list-for-keys")
    List<ButtonInfoRespDTO> buttonListForKeys(@Validated @RequestBody ButtonListForKeysReqDTO buttonListForKeysReqDTO);

    /**
     * 按钮基础信息列表
     *
     * @param buttonListReqDTO buttonListReqDTO
     * @return List
     */
    @RequestMapping("/remote/application/button/bases")
    List<ButtonBaseDTO> bases(@Validated @RequestBody ButtonListReqDTO buttonListReqDTO);

    /**
     * 按钮详情
     *
     * @param buttonInfoReqDTO buttonInfoReqDTO
     * @return ButtonRuleRespDTO
     */
    @RequestMapping("/remote/application/button/info")
    ButtonInfoRespDTO buttonInfo(@Validated @RequestBody ButtonInfoReqDTO buttonInfoReqDTO);
}
